package edu.sctu.practice.class02.lvchang.assign06.test1;

import java.awt.*;

/**
 * Created by socul on 2015/12/10.
 */
public class WordThread extends Thread {

    private char word;
    private int k = 19968;
    private Label com;

    public WordThread(Label com) {
        this.com = com;
    }

    public void run() {
        k = 19968;
        while (true) {
            word = (char) k;
            com.setText("" + word);
            try {
                Thread.sleep(4000);        //调用sleep方法使得线程中断6000豪秒
            } catch (InterruptedException e) {

            }
            k++;
            if (k >= 29968) k = 19968;
        }
    }
}
